package com.mioto.ld.module.feedback.service.impl;

import com.mioto.ld.module.feedback.model.FeedbackDetailAppVO;
import com.mioto.ld.module.feedback.model.FeedbackPagerVO;
import com.mioto.ld.module.feedback.model.FeedbackStatus;
import com.mioto.ld.utils.BaseUtil;
import org.springframework.stereotype.Service;

import com.mioto.ld.module.feedback.dao.FeedbackDao;
import com.mioto.ld.module.feedback.model.Feedback;
import com.mioto.ld.module.feedback.service.IFeedbackService;
import javax.annotation.Resource;
import java.util.List;

/**
 *
 * @author mioto
 * @date 2024-05-14 14:54:42
 */
@Service("feedbackService")
public class FeedbackServiceImpl implements IFeedbackService{

    @Resource
    private FeedbackDao feedbackDao;

    @Override
    public List<Feedback> findList(Feedback feedback) {
        return feedbackDao.findList(feedback);
    }

    @Override
    public int insert(Feedback feedback) {
        feedback.initCreateData();
        feedback.setNo(BaseUtil.createSnowflakeNo());
        feedback.setStatus(FeedbackStatus.FEEDBACK_STATUS_NO_REPLY);
        return feedbackDao.insertIgnoreNull(feedback);
    }

    @Override
    public int update(Feedback feedback) {
        return feedbackDao.update(feedback);
    }

    @Override
    public int updateIgnoreNull(Feedback feedback) {
        return feedbackDao.updateIgnoreNull(feedback);
    }

    @Override
    public Feedback findByColumn(String column, Object value) {
        return feedbackDao.findByColumn(column,value);
    }

    @Override
    public int deleteByColumn(String column, Object value) {
        return feedbackDao.deleteByColumn(column,value);
    }

    @Override
    public int batchDelete(Integer[] ids) {
        return feedbackDao.batchDelete(ids);
    }

    @Override
    public FeedbackDetailAppVO findDetailToApp(Integer feedbackId) {
        return feedbackDao.findDetailToApp(feedbackId);
    }

    @Override
    public List<FeedbackPagerVO> findPager(Feedback feedback) {
        return feedbackDao.findPager(feedback);
    }
}